How to configure hostname for `apache22` package on FreeBSD?

Posted by Eonil on Server Fault See other posts from Server Fault or by Eonil
Published on 2011-02-27T07:05:19Z Indexed on 2011/02/27 7:26 UTC
Read the original article Hit count: 196

Filed under:
|
|
|

I'm configuring development & test FreeBSD machine on VM. I installed apache22 package and restarted. But the daemon does not started with this error:

%apachectl start
httpd: apr_sockaddr_info_get() failed for test.box
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
(13)Permission denied: make_sock: could not bind to address [::]:80
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
%

My hostname is test.box. Because this is temporary test box, it has no real domain-name. But I used 2-level name to avoid long time waiting of sshd on booting.

However, I searched web, and I modified /etc/hosts file like this (I didn't touches this file before):

# This is original configuration
#::1                    localhost localhost.my.domain
#127.0.0.1              localhost localhost.my.domain

# New configuration    
::1                     localhost test.box
127.0.0.1               localhost test.box
127.0.0.1               test.box test

Now apache fails with this error message:

%apachectl start
httpd: Could not reliably determine the server's fully qualified domain name, using test.box for ServerName
(13)Permission denied: make_sock: could not bind to address [::]:80
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
%

I don't know what's required now. Please let me know reason and solution of this error.

---- (edit) ----

The permission errors are caused from omission of sudo.

© Server Fault or respective owner

Related posts about apache

Related posts about configuration